package com.gdx.javatd;

import com.badlogic.gdx.math.Vector2;


public abstract class Monster extends Entity {
	
	protected float attackSpeed;
	protected float moveSpeed;
	protected int num;
	protected int damage;
	protected int cost;
	protected float gain;
	protected float income;
	protected int level;
	protected int range;
	protected boolean alive = true;
	protected static int numM=0;
	protected Route route;
	protected int live;
	protected int timeToCall;
	

	public Monster(int X, int Y, Settlement settlement) {
		super(X, Y);
		
		route = new Route();
		route.addPoint(new Vector2(settlement.getX(), settlement.getY()));
	}
	
	public boolean isAlive() {
		return alive;
	}

	public void setAlive(boolean alive) {
		this.alive = alive;
	}
	
	public void step() {
		Vector2 destination = route.getCurrent();
		
		if (distance(destination.x, destination.y) < 5) {
			//destination = route.getNext();
		} else {
			double angle = angle(destination.x, destination.y);
			setX((float) (X + Math.cos(angle)*moveSpeed));
			setY((float) (Y + Math.sin(angle)*moveSpeed));
		}
	}
	
}
